﻿using System.Collections.Generic;
using System.Linq;

namespace NanoGedcom
{
    public class Gedcom()
    {

        public Header Header { get; } = new Header();
        public List<Individu> Individus { get; } = new List<Individu>();
        public List<Family> Families { get; } = new List<Family>();
        public List<Source> Sources { get; } = new List<Source>();
        public List<Repository> Repositories { get; } = new List<Repository>();
        public List<Submiter> Submiters { get; } = new List<Submiter>();
        public List<Note> Notes { get; } = new List<Note>();

        public Individu GetIndividu(string id)
        {
            return
                (from individu in Individus
                 where individu.Id.Equals(id)
                 select individu).FirstOrDefault();
        }

        public Family GetFamily(string id)
        {
            return
                (from family in Families
                 where family.Id.Equals(id)
                 select family).FirstOrDefault();
        }
    }
}
